package com.shallowUniverse.process.mapper.provider;


import com.shallowUniverse.process.context.sql.SqlSentenceUtil;
import com.shallowUniverse.process.entity.ApprovalDetails;

/**
 * @author gs
 * @date create in 2021/1/17 14:45
 */
public class ApprovalDetailsProvider {

    public String save(ApprovalDetails approvalDetails) {
        return SqlSentenceUtil.generateSentence("insertApprovalDetails");
    }

    public String selectList(ApprovalDetails approvalDetails) {
        //查询字段和条件字符
        String[] entityFields = {"approvalId", "startDate", "endDate", "userId", "info"};
        String[] sqlFields = {"pad.approval_id", "pad.create_date", "pad.create_date", "pad.user_id", "pad.info"};
        String[] signs = {"=", ">=", "<=", "=", "="};
        return SqlSentenceUtil.generateSentenceWithFieldConditions("selectApprovalDetails", approvalDetails, entityFields, sqlFields, signs);
    }

    public String selectById(Long id) {
        return SqlSentenceUtil.generateSentence("selectApprovalDetailsById");
    }

    public String deleteLogic(String id) {
        return SqlSentenceUtil.generateSentence("deleteApprovalDetailsLogic");
    }

    public String delete(String id) {
        return SqlSentenceUtil.generateSentence("deleteApprovalDetails");
    }

    public String deleteByApprovalLogic(String approvalId) {
        return SqlSentenceUtil.generateSentence("deleteApprovalDetailsByApprovalLogic");
    }

    public String deleteByApproval(String approvalId) {
        return SqlSentenceUtil.generateSentence("deleteApprovalDetailsByApproval");
    }
}
